package com.woniuxy.depot.controller;

import com.woniuxy.depot.model.entity.Depot;
import com.woniuxy.depot.service.DepotService;
import com.woniuxy.response.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/depot")
public class DepotController {
    @Resource
    private DepotService depotService;

    @GetMapping("/listForInStock")
    public ResponseResult<List<Depot>> listForInStock(){
        return new ResponseResult<>(ResponseResult.SUCCESS,"success",depotService.listForInStock());
    }

    @GetMapping("/listForOutStock")
    public ResponseResult<List<Depot>> listForOutStock(){
        return new ResponseResult<>(ResponseResult.SUCCESS,"success",depotService.listForOutStock());
    }
}
